
#ifndef __LIBERTY_ENGINE_IASSETFILE_H__
#define __LIBERTY_ENGINE_IASSETFILE_H__

#include <Liberty3D/Liberty3D.h>
#include <ios>
#include <streambuf>
#include <string>
#include <vector>

namespace Liberty { namespace Engine {
    class IAssetFile {
    public:
        virtual ~IAssetFile() {}

    public:
        virtual bool exists(const std::string& resourceName) const = 0;
        virtual std::streambuf* open(const std::string& resourceName, std::ios::openmode mode) const = 0;
        virtual void list(const std::string& folder, std::vector<std::string>& entries) const = 0;

    public:
        static std::shared_ptr<IAssetFile> assetFileForFolder(const std::string& folder);
        static std::shared_ptr<IAssetFile> assetFileForFile  (const std::string& file);
        static std::shared_ptr<IAssetFile> assetFileForLevel (unsigned int levelNumber);

#if defined(WIN32) || defined(WIN64)
        static std::shared_ptr<IAssetFile> assetFileForModule(void* hInstance);
#endif
    };
}}

#endif
